<?php
include'../King/hero.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='login.php';</script>");
?>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <title><?php echo $conf['sitename']; ?>-修改密码</title>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <link rel="stylesheet" type="text/css" href="css/materialdesignicons.min.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/style.min.css">
</head>

<body>
    <div class="container-fluid">

        <div class="row">

            <div class="col-lg-12">
                <div class="card">
                    <header class="card-header">
                        <div class="card-title">修改密码</div>
                    </header>
                    <div class="card-body">

                        <form method="" action="#!" class="site-form">
                            <div class="mb-3">
                                <label for="old-password">旧密码</label>
                                <input type="password" class="form-control" name="oldpwd" id="passa"
                                    placeholder="输入账号的原登录密码">
                            </div>
                            <div class="mb-3">
                                <label for="new-password">新密码</label>
                                <input type="password" class="form-control" name="newpwd" id="pass"
                                    placeholder="输入新的密码">
                            </div>
                            <div class="mb-3">
                                <label for="confirm-password">确认新密码</label>
                                <input type="password" class="form-control" name="confirmpwd" id="passb"
                                    placeholder="确定新的密码">
                            </div>
                            <button type="submit" onclick="set()"class="btn btn-primary">修改密码</button>
                        </form>

                    </div>
                </div>
            </div>

        </div>

    </div>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/popper.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/main.min.js"></script>
<script>  
function set(){//系统配置
        var passa= $("#passa").val(); 
        var pass= $("#pass").val(); 
        var passb= $("#passb").val(); 
        
	
		

		  	$.ajax({
				type : "POST",
				url : "./ajax.php?act=czzm",
				data : {pass,passa,passb},
				dataType : 'json',
				timeout:10000,
				success : function(data) {					  
					
					  $.alert({
                                title: '提示',
                                content: '提交成功！',
                                icon: 'mdi mdi-check-bold',
                                animation: 'scale',
                                closeAnimation: 'scale',
                                buttons: {
                                    okay: {
                                        text: 'OK',
                                        btnClass: 'btn-pink'
                                    }
                                }
                            })
					  if(data.code==1){
						setTimeout(function () {
							location.href="./pwd.php";
						}, 1000); //延时1秒跳转
					  }
				},
				error:function(data){
					$.alert({
                                title: '提示',
                                content: '提交失败！',
                                icon: 'mdi mdi-alert',
                                animation: 'scale',
                                closeAnimation: 'scale',
                                buttons: {
                                    okay: {
                                        text: 'OK',
                                        btnClass: 'btn-red'
                                    }
                                }
                            })
					}
			});
		  	
}
</script>
</body>

</html>
